import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Text {
    public static void main(String[] args) {
        Connection connection=DbUtil.getConnection("root","123123");
        Statement statement=DbUtil.getStatement(connection);
        ResultSet resultSet=null;
        try {
            resultSet=statement.executeQuery("select count(stuno) from s_student");
            while(resultSet.next()){
                int count=resultSet.getInt("count(stuno)");
                System.out.println(count+"人");
            }

        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
        finally {
            DbUtil.closeResultSet(resultSet);
            DbUtil.setClose(connection,statement);
        }
    }
}
